package by.apiskun.curex.services;

import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import by.apiskun.curex.datamodel.ChangeRate;

public interface ChangeRateService {

	ChangeRate get(Long id);

	@Transactional
	void saveOrUpdate(ChangeRate changeRate);

	Long getCount();

	List<ChangeRate> getAllChangeRates();

	@Transactional
	void updateChangeRateCourse(Long id, Double newCourse);

	@Transactional
	void updateChangeRateEndDate(Long id, Date newEndDate);

	List<ChangeRate> getAllChangeRatesByBeforeName(String beforeName);

	List<ChangeRate> getAllChangeRatesByAfterName(String afterName);

	List<ChangeRate> getAllChangeRatesForDay(Date date);

	@Transactional
	void delete(ChangeRate changeRate);

	@Transactional
	void deleteAll();
}
